$OpenBSD: patch-configure_ac,v 1.5 2014/09/23 13:44:03 dcoppa Exp $
--- configure.ac.orig	Tue Aug  5 20:01:05 2014
+++ configure.ac	Tue Sep 23 14:32:19 2014
@@ -82,6 +82,7 @@ AC_ARG_ENABLE(alsa,     [AS_HELP_STRING([--disable-als
 AC_ARG_ENABLE(oss,      [AS_HELP_STRING([--disable-oss     ], [disable Open Sound System output plugin (default: enabled)])], [enable_oss=$enableval], [enable_oss=yes])
 AC_ARG_ENABLE(pulse,    [AS_HELP_STRING([--disable-pulse   ], [disable PulseAudio output plugin (default: enabled)])], [enable_pulse=$enableval], [enable_pulse=yes])
 AC_ARG_ENABLE(coreaudio,[AS_HELP_STRING([--disable-coreaudio], [disable CoreAudio output plugin (default: enabled)])], [enable_coreaudio=$enableval], [enable_coreaudio=yes])
+AC_ARG_ENABLE(sndio,    [AS_HELP_STRING([--disable-sndio   ], [disable sndio output plugin (default: enabled)])], [enable_sndio=$enableval], [enable_sndio=yes])
 AC_ARG_ENABLE(gtk3,     [AS_HELP_STRING([--disable-gtk3     ], [disable GTK3 version of gtkui plugin (default: enabled)])], [enable_gtk3=$enableval], [enable_gtk3=yes])
 AC_ARG_ENABLE(gtk2,     [AS_HELP_STRING([--disable-gtk2     ], [disable GTK2 version of gtkui plugin (default: enabled)])], [enable_gtk2=$enableval], [enable_gtk2=yes])
 AC_ARG_ENABLE(vfs_curl, [AS_HELP_STRING([--disable-vfs-curl], [disable HTTP streaming vfs plugin (default: enabled)])], [enable_vfs_curl=$enableval], [enable_vfs_curl=yes])
@@ -183,8 +184,8 @@ AS_IF([test "${enable_portable}" != "no" -a "${enable_
     PREFIXFLAGS=" -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\""
 ])
 
-CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE $PREFIXFLAGS -DDDB_WARN_DEPRECATED=1"
-CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE $PREFIXFLAGS -DDDB_WARN_DEPRECATED=1"
+CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE $PREFIXFLAGS"
+CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE $PREFIXFLAGS"
 
 AS_IF([test "${enable_staticlink}" != "no"], [
     HAVE_ZLIB=yes
@@ -270,6 +271,16 @@ AS_IF([test "${enable_coreaudio}" != "no" -a "${found_
 
 AC_SUBST(COREAUDIO_LIBS)
 
+AC_CHECK_HEADER([sndio.h], [found_sndio_h=yes], [found_sndio_h=no])
+
+AS_IF([test "${enable_sndio}" != "no" -a "${found_sndio_h}" != "no"], [
+  AC_DEFINE(HAVE_SNDIO, 1, [Build sndio support])
+  HAVE_SNDIO=yes
+  SNDIO_LIBS="-lsndio"
+])
+
+AC_SUBST(SNDIO_LIBS)
+
 AS_IF([test "${enable_ffmpeg}" != "no"], [
     AS_IF([test "${enable_staticlink}" != "no"], [
         FFMPEG_DEPS_CFLAGS="-I../../$LIB/include"
@@ -358,11 +369,11 @@ AS_IF([test "${enable_vorbis}" != "no"], [
         AC_SUBST(VORBIS_LIBS)
         AC_SUBST(VORBIS_CFLAGS)
     ], [
-        AC_CHECK_LIB([vorbis], [main], [HAVE_VORBIS=yes])
-        AC_CHECK_LIB([vorbisfile], [main], [HAVE_VORBISFILE=yes])
+        AC_CHECK_LIB([vorbis], [main], [HAVE_VORBIS=yes], [], [-logg -lm])
+        AC_CHECK_LIB([vorbisfile], [main], [HAVE_VORBISFILE=yes], [], [-lvorbis -logg -lm])
         AS_IF([test "$HAVE_VORBIS" = "yes" -a "${HAVE_VORBISFILE}" = "yes"], [
             HAVE_VORBISPLUGIN=yes
-            VORBIS_LIBS="-lvorbis -lvorbisfile"
+            VORBIS_LIBS="-lvorbis -lvorbisfile -logg -lm"
             AC_SUBST(VORBIS_LIBS)
         ])
     ])
@@ -395,10 +406,10 @@ AS_IF([test "${enable_flac}" != "no"], [
         AC_SUBST(FLAC_CFLAGS)
         AC_SUBST(FLAC_LIBS)
     ], [
-        AC_CHECK_LIB([FLAC], [main], [HAVE_FLAC=yes])
+        AC_CHECK_LIB([FLAC], [main], [HAVE_FLAC=yes], [], [-logg -lm])
         AS_IF([test "${HAVE_FLAC}" = "yes"], [
             HAVE_FLACPLUGIN=yes
-            FLAC_LIBS="-lFLAC"
+            FLAC_LIBS="-lFLAC -logg -lm"
             AC_SUBST(FLAC_LIBS)
         ])
     ])
@@ -695,7 +706,7 @@ AS_IF([test "${enable_aac}" != "no"], [
 ])
 
 AS_IF([test "${enable_mms}" != "no"], [
-    LIBMMS_LIBS=""
+    LIBMMS_LIBS="-lmms"
     AC_SUBST(LIBMMS_LIBS)
     HAVE_MMS=yes
 ])
@@ -748,7 +759,7 @@ AS_IF([test "${enable_pltbrowser}" != "no"], [
     HAVE_PLTBROWSER=yes
 ])
 
-PLUGINS_DIRS="plugins/liboggedit plugins/libmp4ff plugins/libparser plugins/lastfm plugins/mpgmad plugins/vorbis plugins/flac plugins/wavpack plugins/sndfile plugins/vfs_curl plugins/cdda plugins/gtkui plugins/alsa plugins/ffmpeg plugins/hotkeys plugins/oss plugins/artwork plugins/adplug plugins/ffap plugins/sid plugins/nullout plugins/supereq plugins/vtx plugins/gme plugins/pulse plugins/notify plugins/musepack plugins/wildmidi plugins/tta plugins/dca plugins/aac plugins/mms plugins/shellexec plugins/shellexecui plugins/dsp_libsrc plugins/m3u plugins/vfs_zip plugins/converter plugins/dumb plugins/shn plugins/ao plugins/mono2stereo plugins/alac plugins/wma plugins/pltbrowser plugins/coreaudio"
+PLUGINS_DIRS="plugins/liboggedit plugins/libparser plugins/lastfm plugins/mpgmad plugins/vorbis plugins/flac plugins/wavpack plugins/sndfile plugins/vfs_curl plugins/cdda plugins/gtkui plugins/alsa plugins/ffmpeg plugins/hotkeys plugins/oss plugins/artwork plugins/adplug plugins/ffap plugins/sid plugins/nullout plugins/supereq plugins/vtx plugins/gme plugins/pulse plugins/notify plugins/musepack plugins/wildmidi plugins/tta plugins/dca plugins/aac plugins/mms plugins/shellexec plugins/shellexecui plugins/dsp_libsrc plugins/m3u plugins/vfs_zip plugins/converter plugins/dumb plugins/shn plugins/ao plugins/mono2stereo plugins/alac plugins/wma plugins/pltbrowser plugins/coreaudio plugins/sndio"
 
 AM_CONDITIONAL(APE_USE_YASM, test "x$APE_USE_YASM" = "xyes")
 AM_CONDITIONAL(HAVE_VORBIS, test "x$HAVE_VORBISPLUGIN" = "xyes")
@@ -762,6 +773,7 @@ AM_CONDITIONAL(HAVE_GTK2, test "x$HAVE_GTK2" = "xyes")
 AM_CONDITIONAL(HAVE_GTK3, test "x$HAVE_GTK3" = "xyes")
 AM_CONDITIONAL(HAVE_ALSA, test "x$HAVE_ALSAPLUGIN" = "xyes")
 AM_CONDITIONAL(HAVE_COREAUDIO, test "x$HAVE_COREAUDIO" = "xyes")
+AM_CONDITIONAL(HAVE_SNDIO, test "x$HAVE_SNDIO" = "xyes")
 AM_CONDITIONAL(HAVE_FFMPEG, test "x$HAVE_FFMPEGPLUGIN" = "xyes")
 AM_CONDITIONAL(HAVE_PULSE, test "x$HAVE_PULSEPLUGIN" = "xyes")
 AM_CONDITIONAL(HAVE_ARTWORK, test "x$HAVE_ARTWORK" = "xyes")
@@ -841,6 +853,7 @@ PRINT_PLUGIN_INFO([alsa],[ALSA output],[test "x$HAVE_A
 PRINT_PLUGIN_INFO([oss],[oss output plugin],[test "x$HAVE_OSS" = "xyes"])
 PRINT_PLUGIN_INFO([pulse],[PulseAudio output plugin],[test "x$HAVE_PULSEPLUGIN" = "xyes"])
 PRINT_PLUGIN_INFO([coreaudio],[CoreAudio output plugin],[test "x$HAVE_COREAUDIO" = "xyes"])
+PRINT_PLUGIN_INFO([sndio],[sndio output plugin],[test "x$HAVE_SNDIO" = "xyes"])
 PRINT_PLUGIN_INFO([sid],[SID player based on libsidplay2],[test "x$HAVE_SID" = "xyes"])
 PRINT_PLUGIN_INFO([ffap],[Monkey's audio (APE) decoder],[test "x$HAVE_FFAP" = "xyes"])
 PRINT_PLUGIN_INFO([lastfm],[last.fm scrobbler],[test "x$HAVE_LASTFM" = "xyes"])
@@ -888,7 +901,6 @@ Makefile
 pixmaps/Makefile
 icons/Makefile
 plugins/liboggedit/Makefile
-plugins/libmp4ff/Makefile
 plugins/libparser/Makefile
 plugins/gme/Makefile
 plugins/alsa/Makefile
@@ -933,6 +945,7 @@ plugins/alac/Makefile
 plugins/wma/Makefile
 plugins/pltbrowser/Makefile
 plugins/coreaudio/Makefile
+plugins/sndio/Makefile
 intl/Makefile
 po/Makefile.in
 deadbeef.desktop
